package com.test.ll;

public class twofenfa {
	public static void main(String[] args){
		int a[]={};
		int i=1;
		System.out.println(Search(a,i));
		
	}
	public static int Search(int[] a,int x){
		if(a.length==0){return -1;}
		//if(a.length==1){return 0;}
		int start=0;
		int end=a.length-1;
		int m=(start+end)/2;
		while(start<=end){
			if(a[m]==x){return m;}
			if(a[m]>x){
				end=m-1;
			}
			if(a[m]<x){
				start=m+1;
			}
			m=(start+end)/2;
		}
		return -1;
	}
	
}

